(function($)
    {

        // Here is the entry point for your admin javascript
        $('#product_admin_form_product_category_id').change(function(){
            $('#product_admin_form_item_code').attr('value','');
            catid= $(this).attr('value');

            $.ajax({
                type: "POST",
                url:  "subcat",
                data: "catid="+catid,
                success: function(msg){

                   $('#product_admin_form_item_code').attr('value',msg);

                }
            });

        });


        ////////////////////////////////edit /////////////////////////////
        $('#product_admin_form_product_category_id').change(function(){
            $('#product_admin_form_item_code').attr('value','');
            catid= $(this).attr('value');

            $.ajax({
                type: "POST",
                url:  "../../subcat",
                data: "catid="+catid,
                success: function(msg){
                          $('#product_admin_form_item_code').attr('value',msg);

                }
            });

        });
    })(jQuery);